package com.jmb.waimao.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.Map;

/**
 * Email task entity
 */
@Data
@TableName("email_task")
public class EmailTask {

    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * Task name
     */
    private String taskName;

    /**
     * Email subject
     */
    private String subject;

    /**
     * Email content
     */
    private String content;

    /**
     * Sender email address
     */
    private String sender;

    /**
     * Group name for batch sending
     */
    private String targetGroup;

    /**
     * Template ID (optional)
     */
    private Long templateId;

    /**
     * Task status: 0-Created, 1-In Progress, 2-Completed, 3-Failed
     */
    private Integer status;

    /**
     * Total number of emails to send
     */
    private Integer totalCount;

    /**
     * Number of emails successfully sent
     */
    private Integer successCount;

    /**
     * Number of emails failed to send
     */
    private Integer failCount;

    /**
     * Scheduled time to send
     */
    private LocalDateTime scheduledTime;

    /**
     * Creation time
     */
    private LocalDateTime createTime;

    /**
     * Update time
     */
    private LocalDateTime updateTime;

    /**
     * Logical delete flag (0: not deleted, 1: deleted)
     */
    private Integer deleted;

    /**
     * Template variables (not stored in database)
     */
    @TableField(exist = false)
    private Map<String, String> templateVariables;
}
